{include file="public/layout" /}
<style type="text/css">
.yes {
    color: #1BBC9D;
    cursor: default;
}
</style>
<nav class="breadcrumb">
	<i class="Hui-iconfont">&#xe67f;</i> 首页 
	<span class="c-gray en">&gt;</span> 商品管理 
	<span class="c-gray en">&gt;</span> 评论列表
	<a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px" href="javascript:location.replace(location.href);" title="刷新" ><i class="Hui-iconfont">&#xe68f;</i></a>
</nav>
<div class="page-container" style="margin-top: 20px;">
	<div class="cl pd-5 bg-1 bk-gray"> 
		<span class="r">共有数据：<strong>{$count ? $count : 0}</strong> 条</span> 
	</div>
	<table class="table table-border table-bordered table-hover table-bg">
		<thead>
			<tr>
				<th scope="col" colspan="10">评论管理</th>
			</tr>
			<tr class="text-c">
				<th width="25"><input type="checkbox"></th>
				<th width="40">ID</th>
				<th width="200">用户</th>
				<th width="200">评论内容</th>
				<th width="300">商品</th>
				<th width="300">显示</th>
				<th width="300">评论时间</th>
				<th width="300">ip地址</th>
				<th width="300">排序</th>
				<th width="70">操作</th>
			</tr>
		</thead>
		<tbody>
			{if isset($list)}
			{foreach name="list" item="vo" key="k" }
			<tr class="text-c">
				<td><input type="checkbox" value="" name=""></td>
				<td>{$vo.comment_id}</td>
				<td>{$vo.username}</td>
				<td><a>{$vo.content}</a></td>
				<td><a>{$vo.title}</a></td>
				{if $vo.is_show == 0}
				<td><span class="yes" onclick="changeTableVal('Comment','comment_id',{$vo.comment_id},'is_show',this)"><i class="fa fa-check-circle"></i>否</span></td>
				{else /}
				<td><span class="yes" onclick="changeTableVal('Comment','comment_id',{$vo.comment_id},'is_show',this)"><i class="fa fa-check-circle"></i>是</span></td>
				{/if}
				<td>{$vo.add_time|date="Y-m-d H:i:s"}</td>
				<td><a>{$vo.ip_address}</a></td>
				<td><a>{$vo.sort}</a></td>
				<td class="f-14">
					<a title="查看评论" href="{:U('comment/detail',array('id'=>$vo['comment_id']))}" style="text-decoration:none">
					<img src="/public/h-ui.admin/images/y.png" style="width: 15px !important; height: 15px !important;"></a>
					<a title="删除" href="javascript:;" onclick="del(this)" data-url="/Admin/comment/del" data-id="{$vo.comment_id}" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6e2;</i></a>
				</td>
			</tr>
			{/foreach}
			{/if}
		</tbody>
	</table>
	<div>{$list->render()|raw}</div>
</div>
{include file="public/footer" /}
<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/public/h-ui.admin/lib/datatables/1.10.0/jquery.dataTables.min.js"></script>
<script type="text/javascript">
/*删除*/
function del(obj){
	layer.confirm('删除须谨慎，确认要删除吗？',function(index){
		$.ajax({
			type: 'POST',
			url: $(obj).attr('data-url'),
			data:{id: $(obj).attr('data-id')},
			dataType: 'json',
			success: function(data){
				$(obj).parents("tr").remove();
				layer.msg('已删除!',{icon:1,time:1000});
			},
			error:function(data) {
				console.log(data.msg);
			},
		});		
	});
}
</script>
</body>
</html>